package com.example.dbhelperdemo;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import androidx.appcompat.app.AppCompatActivity;

import java.util.List;
import java.util.Map;

public class ResultActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        ListView listView = (ListView) findViewById(R.id.list);
        Intent intent = getIntent();
        List<Map<String, String>> data = (List<Map<String, String>>) intent.getSerializableExtra("list");
        SimpleAdapter sa = new SimpleAdapter(this, data, R.layout.item,
                new String[]{"word", "detail"}, new int[]{R.id.word, R.id.detail});
        listView.setAdapter(sa);
    }
}
